package com.guldan.mapper.db.mapper;

import com.guldan.mapper.db.dto.ProjectBatchStatDTO;
import com.guldan.mapper.db.entity.ProjectRegisterBatch;
import com.guldan.mapper.db.entity.ProjectRegisterBatchExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by Silas.
 * Date: 2016/11/20
 * Time: 11:46
 */
public interface ProjectRegisterBatchMapperExt extends ProjectRegisterBatchMapper {

    /**
     * @param example
     * @param offset
     * @param limit
     * @return
     */
    List<ProjectRegisterBatch> selectByExampleWithPaging(
            @Param("example") ProjectRegisterBatchExample example, @Param("offset") int offset,
            @Param("limit") int limit);


    //统计项目申报批次人数指标，按照batchid统计
    List<ProjectBatchStatDTO> statProjectBatchData(@Param("batchId") Integer batchId,
                                                   @Param("successState") List<Integer> successState,
                                                   @Param("failState") List<Integer> failState);

    //统计项目申报批次人数指标，按照summaryid统计
    List<ProjectBatchStatDTO> statProjectBatchSummaryData(@Param("summaryId") String summaryId,
                                                          @Param("successState") List<Integer> successState,
                                                          @Param("failState") List<Integer> failState);


    //主管部门获取待审批登记批次列表
    List<ProjectRegisterBatch> orgSelectBatchList(@Param("orgCode") String orgCode,
                                                  @Param("states") List<Integer> states,
                                                  @Param("areaIds") List<Integer> areaIds,
                                                  @Param("projectId") Integer projectId,
                                                  @Param("year") Integer year,
                                                  @Param("payCycleCode") String payCycleCode,
                                                  @Param("subsidyCount") Integer subsidyCount,
                                                  @Param("offset") int offset,
                                                  @Param("limit") int limit);

    //主管部门获取待审批登记批次列表
    int orgSelectBatchListCount(@Param("orgCode") String orgCode,
                                @Param("states") List<Integer> states,
                                @Param("areaIds") List<Integer> areaIds,
                                @Param("projectId") Integer projectId,
                                @Param("year") Integer year,
                                @Param("payCycleCode") String payCycleCode,
                                @Param("subsidyCount") Integer subsidyCount
    );


}
